﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace ILookintoControl
{
    using System;
    using System.Windows.Forms;
    using System.Drawing;

    public class AboutBox : Form
    {
        public String Author = "Zhou Wu";
        public String AppName = "WebSite: ";
        public String Version = "1.0";

        public AboutBox()
        {
            InitDialog();
        }

        private void InitDialog()
        {
            this.ClientSize = new Size(250, 140);
            this.Text = "About";
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.ControlBox = false;
            this.MinimizeBox = false;
            this.MaximizeBox = false;

            Button wndClose = new Button();
            wndClose.Text = "OK";
            wndClose.Location = new Point(90, 100);
            wndClose.Size = new Size(72, 24);
            wndClose.Click += new EventHandler(About_OK);

            Label wndAuthorLabel = new Label();
            wndAuthorLabel.Text = "Author:";
            wndAuthorLabel.Location = new Point(5, 5);
            wndAuthorLabel.Size = new Size(72, 24);

            Label wndAuthor = new Label();
            wndAuthor.Text = Author;
            wndAuthor.Location = new Point(80, 5);
            wndAuthor.Size = new Size(80, 24);

            Label wndProdLabel = new Label();

            wndProdLabel.Text = AppName ;
            wndProdLabel.Location = new Point(5, 30);
            wndProdLabel.Size = new Size(72, 24);

            RichTextBox wndProdName  = new RichTextBox();
            wndProdName .Text = "http://www.elookinto.com";
            wndProdName .BackColor = Color.LightGray;
            wndProdName.ScrollBars = RichTextBoxScrollBars.None;
            wndProdName .DetectUrls = true;
            wndProdName .LinkClicked += Link_Clicked;
            wndProdName. Location = new Point(80, 30);
            wndProdName. Size = new Size(155, 24);

            

            Label wndVersionLabel = new Label();
            wndVersionLabel.Text = "Version:";
            wndVersionLabel.Location = new Point(5, 55);
            wndVersionLabel.Size = new Size(72, 24);

            Label wndVersion = new Label();
            wndVersion.Text = Version;
            wndVersion.Location = new Point(80, 55);
            wndVersion.Size = new Size(72, 24);

            this.Controls.AddRange(new Control[] {
                        wndClose,
                        wndAuthorLabel,
                        wndProdLabel,
                        wndVersionLabel,
                        wndAuthor,
                        wndProdName,
                        wndVersion
                        });
            this.StartPosition = FormStartPosition.CenterParent;
            this.ShowDialog();
        }

        private void About_OK(Object source, EventArgs e)
        {
            Control wndCtrl = ((Button)source).Parent;
            ((Form)wndCtrl).Close();
        }

        private void Link_Clicked(object sender, System.Windows.Forms.LinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(e.LinkText);
        }


  
    }


}
